import request from '@/api/myRequest'
// 获取文章列表
function articleListApi(start, limit, data) {
  return request({
    url: `/lejuAdmin/productArticle/findArticles/${start}/${limit}`,
    method: 'POST',
    data
  })
}
// 新增文章
function addArticle(data) {
  return request({
    url: `/lejuAdmin/productArticle/addArticle`,
    method: 'POST',
    data
  })
}

// 删除文章
function delArticle(id) {
  return request({
    url: `/lejuAdmin/productArticle/del/${id}`,
    method: 'DELETE'
  })
}
// 更新文章状态
function changeShowApi(data) {
  return request({
    url: `/lejuAdmin/productArticle/changeShowStatus`,
    method: 'POST',
    data
  })
}
// 文章明细
function articleDetailApi(id) {
  return request({
    url: `/lejuAdmin/productArticle/productArticle/${id}`,
    method: 'GET'
  })
}

// 修改文章
function updateArticle(data) {
  return request({
    url: `/lejuAdmin/productArticle/updateArticle`,
    method: 'POST',
    data
  })
}
export default {
  addArticle,
  articleListApi,
  delArticle,
  changeShowApi,
  updateArticle,
  articleDetailApi
}
